package com.hero.jobweb.service.impl.listener;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;

import com.hero.basicsystem.dao.ICodeDAO;
import com.hero.basicsystem.dao.ext.ICodesortDAOExt;
import com.hero.jobweb.config.CacheData;


/**
 * Spring容器装载完成是，初始化网站数据库缓存数据。
 * @author Volcano
 */
@SuppressWarnings("rawtypes")
public class InitDataSpringListener implements ApplicationListener {

	private static final Log log=LogFactory.getLog(InitDataSpringListener.class);
	private ICodesortDAOExt codeSortDAO;
	private ICodeDAO codeDAO;
	public ICodesortDAOExt getCodeSortDAO() {
		return codeSortDAO;
	}
	public void setCodeSortDAO(ICodesortDAOExt codeSortDAO) {
		this.codeSortDAO = codeSortDAO;
	}
	public ICodeDAO getCodeDAO() {
		return codeDAO;
	}
	public void setCodeDAO(ICodeDAO codeDAO) {
		this.codeDAO = codeDAO;
	}
	public void onApplicationEvent(ApplicationEvent event) {
		log.debug("WEB数据内存加载................");
		CacheData.initData(codeSortDAO, codeDAO);
		log.debug("WEB数据内存加载完成 ");
	}

}
